Introduction

TAKE AWAY POINTS FROM THIS POST

Data

First we read in and organize the data.

## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Loading required package: ggplot2
data = read.table("data_locations.txt", header=T, sep="\t") %>%
  mutate(address = as.character(address)) %>%
  rowwise() %>%
  mutate(longitude = geocode(address, source = "google")[1, 1]) %>%
  mutate(latitude = geocode(address, source = "google")[1, 2])
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Place%20Charles%20de%20Gaulle,%2075008%20Paris,%20France&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=1%20Avenue%20du%20Colonel%20Henri%20Rol-Tanguy,%2075014%20Paris,%20France&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Champ%20de%20Mars,%205%20Avenue%20Anatole%20France,%2075007%20Paris,%20France&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=6%20Parvis%20Notre-Dame%20-%20Pl.%20Jean-Paul%20II,%2075004%20Paris,%20France&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=8%20Rue%20Scribe,%2075009%20Paris,%20France&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Place%20du%20Panth%C3%A9on,%2075005%20Paris,%20France&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=16%20Rue%20du%20Repos,%2075020%20Paris,%20France&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=35%20Rue%20du%20Chevalier%20de%20la%20Barre,%2075018%20Paris,%20France&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=8%20Boulevard%20du%20Palais,%2075001%20Paris,%20France&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Place%20de%20la%20R%C3%A9publique,%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Louvre%20Museum,%2075001%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=1%20Rue%20de%20la%20L%C3%A9gion%20d%E2%80%99Honneur,%2075007%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=79%20Rue%20de%20Varenne,%2075007%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=5%20Rue%20de%20Thorigny,%2075003%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=2%20Rue%20Louis%20Boilly,%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Jardin%20Tuileries,%2075001%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=6%20Rue%20de%20Furstenberg,%2075006%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Place%20Georges-Pompidou,%2075004%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=129%20Rue%20de%20Grenelle,%2075007%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=6%20Place%20Paul%20Painlev%C3%A9,%2075005%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=107%20Rue%20de%20Rivoli,%2075001%20Paris,%20France&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=16%20Rue%20des%20Francs%20Bourgeois,%2075003%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=30%20Avenue%20Corentin%20Cariou,%2075019%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=17%20Rue%20Geoffroy%20l%E2%80%99Asnier,%2075004%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=158%20Boulevard%20Haussmann,%2075008%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=37%20Quai%20Branly,%2075007%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Matth%C3%A4ikirchplatz,%2010785%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Schlo%C3%9Fstra%C3%9Fe%2055,%2014059%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Lansstra%C3%9Fe%208,%2014195%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Unter%20den%20Linden%202,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Invalidenstra%C3%9Fe%2043,%2010115%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Invalidenstra%C3%9Fe%2050-51,%2010557%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Lindenstra%C3%9Fe%209-14,%2010969%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Alte%20Jakobstra%C3%9Fe%20124-128,%2010969%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Trebbiner%20Str.%209,%2010963%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Friedrichstra%C3%9Fe%2043-45,%2010969%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Niederkirchnerstra%C3%9Fe%208,%2010963%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Karl-Liebknecht-Str.%201,%2010178%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Kurf%C3%BCrstendamm%20207,%2010719%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Haus%201,%20Ruschestra%C3%9Fe%20103,%2010365%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Auguststra%C3%9Fe%2026,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=J%C3%A4gerstrasse%205,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Am%20Lustgarten,%2010178%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Breitscheidplatz,%2010789%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Gendarmenmarkt%201-2,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Gendarmenmarkt%201-5,%2010117%20Berlin,%20Germany&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Karl-Liebknecht-Str.%208,%2010178%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Nikolaikirchplatz,%2010178%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Hinter%20der%20Katholischen%20Kirche%203,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Oranienburger%20Str.%2028-30,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Klosterstra%C3%9Fe%2073,%2010179%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Panoramastra%C3%9Fe%201A,%2010178%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Platz%20der%20Republik%201,%2011011%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Hammarskj%C3%B6ldplatz,%2014055%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Gro%C3%9Fer%20Stern,%2010557%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Kollhoff-Tower,%20Potsdamer%20Platz%201,%2010785%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Cora-Berliner-Stra%C3%9Fe%201,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Bernauer%20Str.%20111,%2013355%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Friedrichstra%C3%9Fe%2043-45,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Tempelhofer%20Damm%201-7,%2012107%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Hardenbergplatz%208,%2010787%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Am%20Tierpark%20125,%2010319%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Passeig%20Don%20Joan%20Borb%C3%B3%20Comte%20Barcelona,%20S/N,%2008039%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Pla%C3%A7a%20Reial,%2012,%2008002%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=08024%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Carrer%20de%20Mallorca,%20401,%2008013%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Proven%C3%A7a,%20261-265,%2008008%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Passeig%20de%20Gr%C3%A0cia,%2043,%2008007%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Carrer%20Nou%20de%20la%20Rambla,%203-5,%2008001%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Carrer%20de%20Bellesguard,%2016,%2008022%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Pla%C3%A7a%20de%20Catalunya,%2017,%2008002%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Parc%20del%20F%C3%B2rum,%20Museu%20Blau,%20Parque%20del%20F%C3%B3rum,%20Plaza%20Leonardo%20da%20Vinci,%204-5,%2008019%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Carrer%20de%20Roc%20Boronat,%20116-126,%2008018%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Carrer%20d%E2%80%99Isaac%20Newton,%2026,%2008022%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Pla%C3%A7a%20del%20Tibidabo,%203-4,%2008035%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=119%2008%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Karl%C5%AFv%20most,%20110%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Karmelitsk%C3%A1%20385/9,%20118%2000%20Praha%201-Mal%C3%A1%20Strana,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Loret%C3%A1nsk%C3%A9%20n%C3%A1m.%20100/7,%20118%2000%20Praha,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Strahovsk%C3%A9%20n%C3%A1dvo%C5%99%C3%AD%201/132,%20118%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Jir%C3%A1skovo%20n%C3%A1m.%201981/6,%20120%2000%20Praha%202,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=V%20Pevnosti%20159/5b,%20128%2000%20Praha%202,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Pet%C5%99%C3%ADnsk%C3%A9%20sady,%20118%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=N%C3%A1b%C5%99e%C5%BE%C3%AD%20Edvarda%20Bene%C5%A1e,%20118%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=N%C3%A1rodn%C3%AD%20118/16,%20110%2000%20Praha%201-Nov%C3%A9%20M%C4%9Bsto,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=U%20Trojsk%C3%A9ho%20z%C3%A1mku%203/120,%20171%2000%20Praha%207,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=U%20pam%C3%A1tn%C3%ADku%201900,%20130%2000%20Praha,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Starom%C4%9Bstsk%C3%A9%20n%C3%A1m.%2012,%20110%2015%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=V%C3%A1clavsk%C3%A9%20n%C3%A1m.%2068,%20115%2079%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Mari%C3%A1nsk%C3%A9%20n%C3%A1m.%2098/1,%20110%2000%20Praha%201-Star%C3%A9%20M%C4%9Bsto,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Husova%20229/19,%20110%2000%20Praha,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=17.%20listopadu%202,%20110%2000%20Praha,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Kosteln%C3%AD%201320/42,%20170%2078%20Praha%207,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=U%20Pam%C3%A1tn%C3%ADku%201600/2,%20130%2000%20Praha%203-%C5%BDi%C5%BEkov,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=U%20Star%C3%A9%20%C5%A1koly%20141/1,%20110%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Mozartova%20129,%20150%2000%20Praha%205,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Na%20Po%C5%99%C3%AD%C4%8D%C3%AD%201554/52,%20186%2000%20Praha%208-Nov%C3%A9%20M%C4%9Bsto,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Kaunick%C3%BD%20Pal%C3%A1c,%20Pansk%C3%A1%207,%20110%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Ciheln%C3%A1%20635/2b,%20118%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Vald%C5%A1tejnsk%C3%A1%20161/20,%20118%2000%20Praha-Mal%C3%A1%20Strana,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Nad%20Hradn%C3%ADm%20Vodojemem%20642/14,%20St%C5%99e%C5%A1ovice,%20162%2000%20Praha%206,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Na%20P%C5%99%C3%ADkop%C4%9B%2010,%20110%2000%20Praha,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Sask%C3%A1%2080/1,%20118%2000%20Praha%201-Mal%C3%A1%20Strana,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Ji%C5%99sk%C3%A1%203,%20119%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Poup%C4%9Btova%201,%20170%2000%20Praha%207,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Ke%20Skl%C3%A1rn%C4%9B%203213/15,%20150%2000%20Praha%205,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=U%20Sovov%C3%BDch%20ml%C3%BDn%C5%AF%202,%20118%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Betl%C3%A9msk%C3%A9%20n%C3%A1m.%20169/5a,%20110%2000%20Praha-Star%C3%A9%20M%C4%9Bsto,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Place%20Charles%20de%20Gaulle,%2075008%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=1%20Avenue%20du%20Colonel%20Henri%20Rol-Tanguy,%2075014%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Champ%20de%20Mars,%205%20Avenue%20Anatole%20France,%2075007%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=6%20Parvis%20Notre-Dame%20-%20Pl.%20Jean-Paul%20II,%2075004%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=8%20Rue%20Scribe,%2075009%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Place%20du%20Panth%C3%A9on,%2075005%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=16%20Rue%20du%20Repos,%2075020%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=35%20Rue%20du%20Chevalier%20de%20la%20Barre,%2075018%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=8%20Boulevard%20du%20Palais,%2075001%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Place%20de%20la%20R%C3%A9publique,%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Louvre%20Museum,%2075001%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=1%20Rue%20de%20la%20L%C3%A9gion%20d%E2%80%99Honneur,%2075007%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=79%20Rue%20de%20Varenne,%2075007%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=5%20Rue%20de%20Thorigny,%2075003%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=2%20Rue%20Louis%20Boilly,%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Jardin%20Tuileries,%2075001%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=6%20Rue%20de%20Furstenberg,%2075006%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Place%20Georges-Pompidou,%2075004%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=129%20Rue%20de%20Grenelle,%2075007%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=6%20Place%20Paul%20Painlev%C3%A9,%2075005%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=107%20Rue%20de%20Rivoli,%2075001%20Paris,%20France&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=16%20Rue%20des%20Francs%20Bourgeois,%2075003%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=30%20Avenue%20Corentin%20Cariou,%2075019%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=17%20Rue%20Geoffroy%20l%E2%80%99Asnier,%2075004%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=158%20Boulevard%20Haussmann,%2075008%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=37%20Quai%20Branly,%2075007%20Paris,%20France&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Matth%C3%A4ikirchplatz,%2010785%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Schlo%C3%9Fstra%C3%9Fe%2055,%2014059%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Lansstra%C3%9Fe%208,%2014195%20Berlin,%20Germany&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Unter%20den%20Linden%202,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Invalidenstra%C3%9Fe%2043,%2010115%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Invalidenstra%C3%9Fe%2050-51,%2010557%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Lindenstra%C3%9Fe%209-14,%2010969%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Alte%20Jakobstra%C3%9Fe%20124-128,%2010969%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Trebbiner%20Str.%209,%2010963%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Friedrichstra%C3%9Fe%2043-45,%2010969%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Niederkirchnerstra%C3%9Fe%208,%2010963%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Karl-Liebknecht-Str.%201,%2010178%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Kurf%C3%BCrstendamm%20207,%2010719%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Haus%201,%20Ruschestra%C3%9Fe%20103,%2010365%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Auguststra%C3%9Fe%2026,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=J%C3%A4gerstrasse%205,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Am%20Lustgarten,%2010178%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Breitscheidplatz,%2010789%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Gendarmenmarkt%201-2,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Gendarmenmarkt%201-5,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Karl-Liebknecht-Str.%208,%2010178%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Nikolaikirchplatz,%2010178%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Hinter%20der%20Katholischen%20Kirche%203,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Oranienburger%20Str.%2028-30,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Klosterstra%C3%9Fe%2073,%2010179%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Panoramastra%C3%9Fe%201A,%2010178%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Platz%20der%20Republik%201,%2011011%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Hammarskj%C3%B6ldplatz,%2014055%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Gro%C3%9Fer%20Stern,%2010557%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Kollhoff-Tower,%20Potsdamer%20Platz%201,%2010785%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Cora-Berliner-Stra%C3%9Fe%201,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Bernauer%20Str.%20111,%2013355%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Friedrichstra%C3%9Fe%2043-45,%2010117%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Tempelhofer%20Damm%201-7,%2012107%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Hardenbergplatz%208,%2010787%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Am%20Tierpark%20125,%2010319%20Berlin,%20Germany&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Passeig%20Don%20Joan%20Borb%C3%B3%20Comte%20Barcelona,%20S/N,%2008039%20Barcelona,%20Spain&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Pla%C3%A7a%20Reial,%2012,%2008002%20Barcelona,%20Spain&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=08024%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Carrer%20de%20Mallorca,%20401,%2008013%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Proven%C3%A7a,%20261-265,%2008008%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Passeig%20de%20Gr%C3%A0cia,%2043,%2008007%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Carrer%20Nou%20de%20la%20Rambla,%203-5,%2008001%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Carrer%20de%20Bellesguard,%2016,%2008022%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Pla%C3%A7a%20de%20Catalunya,%2017,%2008002%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Parc%20del%20F%C3%B2rum,%20Museu%20Blau,%20Parque%20del%20F%C3%B3rum,%20Plaza%20Leonardo%20da%20Vinci,%204-5,%2008019%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Carrer%20de%20Roc%20Boronat,%20116-126,%2008018%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Carrer%20d%E2%80%99Isaac%20Newton,%2026,%2008022%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Pla%C3%A7a%20del%20Tibidabo,%203-4,%2008035%20Barcelona,%20Spain&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=119%2008%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Karl%C5%AFv%20most,%20110%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Karmelitsk%C3%A1%20385/9,%20118%2000%20Praha%201-Mal%C3%A1%20Strana,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Loret%C3%A1nsk%C3%A9%20n%C3%A1m.%20100/7,%20118%2000%20Praha,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Strahovsk%C3%A9%20n%C3%A1dvo%C5%99%C3%AD%201/132,%20118%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Jir%C3%A1skovo%20n%C3%A1m.%201981/6,%20120%2000%20Praha%202,%20Czech%20Republic&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=V%20Pevnosti%20159/5b,%20128%2000%20Praha%202,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Pet%C5%99%C3%ADnsk%C3%A9%20sady,%20118%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=N%C3%A1b%C5%99e%C5%BE%C3%AD%20Edvarda%20Bene%C5%A1e,%20118%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=N%C3%A1rodn%C3%AD%20118/16,%20110%2000%20Praha%201-Nov%C3%A9%20M%C4%9Bsto,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=U%20Trojsk%C3%A9ho%20z%C3%A1mku%203/120,%20171%2000%20Praha%207,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=U%20pam%C3%A1tn%C3%ADku%201900,%20130%2000%20Praha,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Starom%C4%9Bstsk%C3%A9%20n%C3%A1m.%2012,%20110%2015%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=V%C3%A1clavsk%C3%A9%20n%C3%A1m.%2068,%20115%2079%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Mari%C3%A1nsk%C3%A9%20n%C3%A1m.%2098/1,%20110%2000%20Praha%201-Star%C3%A9%20M%C4%9Bsto,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Husova%20229/19,%20110%2000%20Praha,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=17.%20listopadu%202,%20110%2000%20Praha,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Kosteln%C3%AD%201320/42,%20170%2078%20Praha%207,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=U%20Pam%C3%A1tn%C3%ADku%201600/2,%20130%2000%20Praha%203-%C5%BDi%C5%BEkov,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=U%20Star%C3%A9%20%C5%A1koly%20141/1,%20110%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Mozartova%20129,%20150%2000%20Praha%205,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Na%20Po%C5%99%C3%AD%C4%8D%C3%AD%201554/52,%20186%2000%20Praha%208-Nov%C3%A9%20M%C4%9Bsto,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Kaunick%C3%BD%20Pal%C3%A1c,%20Pansk%C3%A1%207,%20110%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Ciheln%C3%A1%20635/2b,%20118%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Vald%C5%A1tejnsk%C3%A1%20161/20,%20118%2000%20Praha-Mal%C3%A1%20Strana,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Nad%20Hradn%C3%ADm%20Vodojemem%20642/14,%20St%C5%99e%C5%A1ovice,%20162%2000%20Praha%206,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Na%20P%C5%99%C3%ADkop%C4%9B%2010,%20110%2000%20Praha,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Sask%C3%A1%2080/1,%20118%2000%20Praha%201-Mal%C3%A1%20Strana,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Ji%C5%99sk%C3%A1%203,%20119%2000%20Praha%201,%20Czech%20Republic&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Poup%C4%9Btova%201,%20170%2000%20Praha%207,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Ke%20Skl%C3%A1rn%C4%9B%203213/15,%20150%2000%20Praha%205,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=U%20Sovov%C3%BDch%20ml%C3%BDn%C5%AF%202,%20118%2000%20Praha%201,%20Czech%20Republic&sensor=false
## .
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Betl%C3%A9msk%C3%A9%20n%C3%A1m.%20169/5a,%20110%2000%20Praha-Star%C3%A9%20M%C4%9Bsto,%20Czech%20Republic&sensor=false

Let’s view the data.

We then create a map object pulled from Google maps with each city and the

# Get city specific maps
paris_map = get_googlemap(center = "Paris", maptype = "roadmap", zoom = 12, size = c(640, 420))
## Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=Paris&zoom=12&size=640x420&scale=2&maptype=roadmap&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Paris&sensor=false
berlin_map = get_googlemap(center = "Berlin", maptype = "roadmap", zoom = 11, size = c(640, 420))
## Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=Berlin&zoom=11&size=640x420&scale=2&maptype=roadmap&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Berlin&sensor=false
barcelona_map = get_googlemap(center = "Barcelona", maptype = "roadmap", zoom = 12, size = c(640, 420))
## Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=Barcelona&zoom=12&size=640x420&scale=2&maptype=roadmap&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Barcelona&sensor=false
prague_map = get_googlemap(center = "Prague", maptype = "roadmap", zoom = 12, size = c(640, 420))
## Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=Prague&zoom=12&size=640x420&scale=2&maptype=roadmap&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Prague&sensor=false
# Plot city specific maps with markers
paris.plot = ggmap(paris_map, extent = "device") +
  geom_point(data = subset(data, city == "Paris"), aes(x = longitude, y = latitude),
             color = "red", size = 4)

paris.plot

berlin.plot = ggmap(berlin_map, extent = "device") +
  geom_point(data = subset(data, city == "Berlin"), aes(x = longitude, y = latitude),
             color = "red", size = 4)

berlin.plot

barcelona.plot = ggmap(barcelona_map, extent = "device") +
  geom_point(data = subset(data, city == "Barcelona"), aes(x = longitude, y = latitude),
             color = "red", size = 4)

barcelona.plot

prague.plot = ggmap(prague_map, extent = "device") +
  geom_point(data = subset(data, city == "Prague"), aes(x = longitude, y = latitude),
             color = "red", size = 4)

prague.plot

With our maps and data points in place let’s compute the tessilation for each map.

library(deldir)
## Warning: package 'deldir' was built under R version 3.2.4
## deldir 0.1-12
# data_deldir = data %>%
#   group_by(city) %>%
#   do(deldir(.$longitude, .$latitude)) %>%
#   ungroup()
# 
# 
# data_deldir = data %>%
#   nest(-city) %>%
#   mutate(col = map2(longitude, latitude, deldir)) %>%
#   select(city, col) %>%
#   unnest()



### TO BE CHANGED
paris_data = filter(data, city == "Paris")
paris_deldir = deldir(paris_data$longitude, paris_data$latitude)
## 
##      PLEASE NOTE:  The components "delsgs" and "summary" of the
##  object returned by deldir() are now DATA FRAMES rather than
##  matrices (as they were prior to release 0.0-18).
##  See help("deldir").
##  
##      PLEASE NOTE: The process that deldir() uses for determining
##  duplicated points has changed from that used in version
##  0.0-9 of this package (and previously). See help("deldir").
berlin_data = filter(data, city == "Berlin")
berlin_deldir = deldir(berlin_data$longitude, berlin_data$latitude)

barcelona_data = filter(data, city == "Barcelona")
barcelona_deldir = deldir(barcelona_data$longitude, barcelona_data$latitude)

prague_data = filter(data, city == "Prague")
prague_deldir = deldir(prague_data$longitude, prague_data$latitude)

Now we can update our figures with the tessliations.

paris_del.plot = paris.plot +
  geom_segment(data = paris_deldir$delsgs, aes(x = x1, y = y1, xend = x2, yend = y2),
    size = 1, color= "black")

paris_del.plot

berlin_del.plot = berlin.plot +
  geom_segment(data = berlin_deldir$delsgs, aes(x = x1, y = y1, xend = x2, yend = y2),
    size = 1, color= "black")

berlin_del.plot

barcelona_del.plot = barcelona.plot +
  geom_segment(data = barcelona_deldir$delsgs, aes(x = x1, y = y1, xend = x2, yend = y2),
    size = 1, color= "black")

barcelona_del.plot

prague_del.plot = prague.plot +
  geom_segment(data = prague_deldir$delsgs, aes(x = x1, y = y1, xend = x2, yend = y2),
    size = 1, color= "black")

prague_del.plot

Let’s compare the areas. The area for Paris is 0.004232, Berlin 0.011105, Barelona 0.002051, and Prague 0.002625.

Conclusion